setwd("E:/作业/R语言/附件/实践3")
X=read.csv("x.csv")
rownames(X)=X[,2]   
X=X[,-1]
X=X[,-1]
X=log2(X)
X[X==-Inf]=NA
group=colnames(X)
group=gsub("[0-9]","",group) 
P=NULL
for(i in 1:length(rownames(X)))   
{
  data=unlist(X[i,])   
  count=tapply(data,group,function(x){sum(!is.na(x))})   
  {
    if(count[1]<3|count[2]<3|count[3]<3)   
      P=c(P,NA)   
    else
    {
      data=data.frame(data,group)   
      aov1=summary(aov(data~group,data))   
      P=c(P,aov1[[1]][1,5])   
    }
  }
}
X$P=P

